package com.example.test.责任链回顾;

import com.example.test.bean.User;

public class HandelBean {

    AbstractHandel header;
    AbstractHandel temp;


    public void setHandel(AbstractHandel handel){

        if (header==null) {
            header = handel;
            temp = handel;
            return;
        }

        temp.setNextHandel(handel);
        temp = handel;
    }

    public void doHandel(User user) {
        if (header !=null) {
            header.handel(user);
        }
    }
}
